[FIX] account_payment_order: Manager can create partner bank accounts #1500
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have found the following unexpected behavior while writing the tests of OCA/l10n-italy#4920:
AccountTestInvoicingCommon, note that theself.env.useris an account manager.res.partner.bankrecordExpected:
The record is created
Actual:
Additional context
The root cause is that in
bank-payment/account_payment_order/security/ir.model.access.csv
Line 7 in 311be5c
In the tests of
16.0this was not a problem because the account manager created byAccountTestInvoicingCommonwas inheriting the groups of OdooBot in https://github.com/odoo/odoo/blob/5de47fb3bd4619dab2c84fff8f08d69dfee7b308/addons/account/tests/common.py#L49.This is no more the case in
18.0, where the account manager only has the account manager groups (see https://github.com/odoo/odoo/blob/0745730d44ad2a0e198a6f37b4ee7cb8e88f30ea/addons/account/tests/common.py#L248).I understand there are security implications for this change, but I think it makes sense that an account manager can create bank accounts of the partners.
Please let me know if I'm wrong or if there are better solutions! Thanks